home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_01_03
/
1n03055b
< prev
next >
Wrap
Text File
|
1990-07-03
|
960b
|
42 lines
$FUNCTION
cint
CLEAR VAR upass
SET VAR upass TEXT arg1 TEXT unull TEXT ulen INT uchar TEXT ucount INT
SET VAR arg1 = .%1 *(argument one)
SET VAR ucount = 1
SET VAR ulen = (SLEN(.arg1))
SET ERROR VAR errvar
WHILE ucount LE .ulen THEN
SET VAR uchar = (SGET(.arg1,1,.uco9unt))
SET VAR uchar INT
IF errvar EQ 0 THEN
SET VAR uchar TEXT
SET VAR upass = (.upass + .uchar)
ELSE
WRITE "Value must be numeric" AT 1 1
SET VAR vpas = 0
GOTO skipper
ENDIF
SET VAR ucount = (.ucount + 1)
ENDWHILE
SET VAR ulen = (SLEN(.upass))
IF ulen GT 9 THEN
BEEP
CLS FROM 1 to 2
WRITE "Maximum integer length is 9 digits" AT 1 1 LIGHT RED
WRITE "Press any key to continue..."
PAUSE
CLS FROM 1 to 2
SET VAR upass = 0
ELSE
IF ulen = 0 THEN
SET VAR upass = (.upass)
ENDIF
ENDIF
LABEL skipper
SET VAR upass INT
CLEAR arg1 uchar ulen ucount errvar
RETURN .upass